<template>
	<div class="company-authen">
		<!-- 顶部用户信息 -->
		<v-info :formData="formData" :imgs1="imgs1" :imgs2="imgs2"></v-info>
		<!-- 认证记录 -->	
		<template v-if="full">
			<div class="company-authen-content company-authen-content-yes" v-if="authenList.length>0">
				<table>
					<tbody>
						<tr>
							<td>{{$t('common.company.companyInfo2')}}</td>
							<td>{{$t('common.company.authenTime')}}</td>
							<td>{{$t('common.company.anthenStatus')}}</td>
						</tr>
						<tr v-for="(item ,index) in authenList" :key="index">
							<td>
								<p class="font16">{{item.enterpriseResources.enterpriseName}}</p>
								<p class="font14 h99">{{$t('common.company.enterpriseInfo')}}  {{item.enterpriseResources.completionRate}}%</p>
							</td>
							<td><p class="font14 h66">{{item.createTime}}</p></td>
							<td>
								<p class="dairenz">{{item.statusTxt}}</p>
								<p class="h99" v-if="item.auditOpinion">（{{item.auditOpinion}}）</p>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div class="company-authen-content company-authen-content-no flexColumn flexItems" v-else>
				<i class="el-icon-document font35"></i>
				<p>{{$t('common.company.companytask2')}}</p>
				<!-- <router-link to="" class="zmlBtn1">{{$t('common.company.goAuthen')}}</router-link> -->
			</div>
		</template>
		
		
	</div>
</template>
<script>
	import {companyInfo,ajaxAdd} from '@/utils/js.js'
	import {enterpriseCertLog,details} from '@/services/api.js'
  import info from '@/components/info.vue'
	export default {
		components:{
			'v-info':info
		},
    data(){
      return{
      rz: false, //是否认证
      authenList:[],
      formData:{},
      imgs1:'',
      imgs2:'',
			imgUrl:this.$store.state.imgUrl,
			full:false
      }
    },
	methods:{
		content(){
			//企业信息
      companyInfo(this,details)
			
			ajaxAdd(this,enterpriseCertLog,{},res=>{
				console.log('企业认证记录',res)
				this.authenList = res.data
				this.full = true
			})
      
		}
	},
	mounted() {
		this.content()
	},
	watch:{
		'$i18n.locale'(){
			this.content()
		},
	}
  }
</script>
<style lang="scss">
.company-authen{
	.company-authen-content{
		width: 100%;
		min-height: 890px;
		background-color: #fff;
		margin-top: 12px;
	}
	.company-authen-content-no{
		i{color: #CCCCCC;margin-top: 60px;}
		p{margin-top: 20px;}
		a{margin-top: 50px;}
	}
	.company-authen-content-yes{
		padding: 30px 20px;
		table{
			width: 100%;
			tr{
				display: flex;
				border: 1px solid #EDEDED;
				border-top: 0;
				td{
					flex: 1;
					height: 85px;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
				}
				td:nth-of-type(1){
					flex: 0.8;
					align-items: flex-start;
					padding-left: 50px;
					box-sizing: border-box;
					p:nth-of-type(1){
						font-weight: bold;
						color: #0F54BC;
						margin-bottom: 6px;
					}
				}
			}
			tr:nth-of-type(1){
				background-color: #F2F6FE;border: 0;
				td{height: 50px;}
			}
		}
		.dairenz{
			color: #E81E19;
		}
	}
}

</style>
